package com.atguigu.srb.service.sms.controller;

import com.atguigu.srb.base.result.ResponseVo;
import com.atguigu.srb.service.sms.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags="短信发送模块")
@RestController
//@CrossOrigin
@RequestMapping("/api/sms")
public class SmsController {
    @Resource
    SmsService smsService;

    @ApiOperation("发送短信")
    //mobile:发送短信的手机号码   type：发送的类型
    @GetMapping("sendSms/{mobile}/{type}")
    public ResponseVo sendSms(@PathVariable("mobile")String mobile,
                              @PathVariable("type")Integer type){
        smsService.sendSms(mobile,type);
        return ResponseVo.ok().message("短信发送成功");
    }

}
